package com.tools.starter.swagger.rest;

import com.tools.starter.swagger.sqlite.MockEntity;
import com.tools.starter.swagger.sqlite.SQLiteManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author com.tools
 * @version 1.0
 * @Description: MockController
 * <com.tools.starter.swagger.rest>
 * @date Created in 2020/8/31 18:39
 **/
@RestController
public class MockController {

    @Autowired
    public MockController() {

    }

    @RequestMapping("/mock/save")
    public Object saveMock(@RequestParam("pathUrl")String pathUrl, @RequestParam("mockData") String mockData) {
        MockEntity entity = new MockEntity();
        entity.setPathUrl(pathUrl);
        entity.setMockData(mockData);
        SQLiteManager.save(entity);
        //蚂蚁，携程，微盟，躺平，1药网，拍拍贷，上汽
        return "success";
    }
}
